#ifndef __RC4__
#define __RC4__

#include <iostream>

using namespace std;

typedef unsigned char u_char;

const int rc4_key_len = 11;
const char rc4_key[]  = "WhatTheFuck";

class RC4
{
public:
    RC4(){}
    ~RC4(){}
    bool encrypt(u_char* data, u_char* pOut, int len);
    bool decrypt(u_char* data, u_char* pOut, int len);
private:
    void initialize();
    void ksa();
    void rc4(u_char *inbuf, u_char *outbuf, int buflen);
    void swap(u_char *a, u_char *b);
    u_char * prng(int msglength) ;
    u_char state[256];
};

#endif
